package android.mcsmtms.activity;

import android.mcsmtms.R;
import android.mcsmtms.R.layout;
import android.mcsmtms.R.menu;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.text.method.ScrollingMovementMethod;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class DisplayErrorActivity extends Activity {

	private TextView errorTextView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_display_error);
		
		errorTextView = (TextView) findViewById(R.id.tv_error_message);

		errorTextView.setText(getIntent().getStringExtra("errorMessage"));
		errorTextView.setMovementMethod(new ScrollingMovementMethod());
		
		findViewById(R.id.btn_exit).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View view) {
						//finish();
						Intent intent = new Intent(Intent.ACTION_MAIN);
					    intent.addCategory(Intent.CATEGORY_HOME);
					    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY);
					    
					    startActivity(intent);
					    //finish(); 
						android.os.Process.killProcess(android.os.Process.myPid());
						System.exit(10);
					}
				});
	}

}
